package com.yejing.poidemo;

import cn.hutool.core.io.FastByteArrayOutputStream;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.IoUtil;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class Demo2 {


    public static void main(String[] args) {
        String filePath = "d:/美的20HP接口说明.xlsx";
        if(filePath.indexOf(".") != -1){
            String str = filePath.substring(filePath.indexOf(".")+1,filePath.length());
            if(!str.equals("xls") && !str.equals("xlsx")){
                filePath += ".xls";
            }
            System.out.println(str);
        }
        System.out.println(filePath);
//        try {
//            FastByteArrayOutputStream read = IoUtil.read(new FileInputStream(new File(filePath)));
//            byte[] byteArray = read.toByteArray();
//            StringBuilder sb = new StringBuilder();
//            sb.append("[");
//            for (byte b : byteArray) {
//                sb.append(b).append(",");
//            }
//            sb.append("]");
//            System.out.println(sb.toString());
//        } catch (FileNotFoundException e) {
//            throw new RuntimeException(e);
//        }


    }
}
